package com.jsj.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;


@Component
public class SubmissionTopic extends BaseEntity {

    /**
     * 提交作业id
     */
    private int id;

    /**
     * 作业id
     */
    private int topicId;

    /**
     * 提交者
     */
    private String userId;

    /**
     * 提交时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;
    /**
     * 提交题目
     */
    private List<Submission> submissions;


    public SubmissionTopic() {
    }

    public SubmissionTopic(int id, int topicId, String userId, Date createTime, List<Submission> submissions) {
        this.id = id;
        this.topicId = topicId;
        this.userId = userId;
        this.createTime = createTime;
        this.submissions = submissions;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getTopicId() {
        return topicId;
    }

    public void setTopicId(int topicId) {
        this.topicId = topicId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public List<Submission> getSubmissions() {
        return submissions;
    }

    public void setSubmissions(List<Submission> submissions) {
        this.submissions = submissions;
    }

    @Override
    public String toString() {
        return "SubmissionTopic{" +
                "id=" + id +
                ", topicId=" + topicId +
                ", userId='" + userId + '\'' +
                ", createTime=" + createTime +
                ", submissions=" + submissions +
                '}';
    }
}
